package com.ishopping.api.manage.enums;

/**
 * Created by JIM on 2016/8/10.
 */
public enum ResourceEnum {
    MENU("0", "菜单"),
    OPERATION("1", "超链接或按钮");

    private String value;

    private String text;

    private ResourceEnum(String value, String text) {
        this.value = value;
        this.text = text;
    }

    public String getValue() {
        return this.value;
    }

    public String getText() {
        return this.text;
    }

    public static String getTextByValue(String value) {
        String text = null;
        for (ResourceEnum e : ResourceEnum.values()) {
            if (e.getValue().equals(value)) {
                text = e.getText();
                break;
            }
        }
        return text;
    }
}
